package com.pty.demo.behaviour.chain;

import java.math.BigDecimal;

/**
 * @author pengty
 * @date 2020/3/16
 */
public class CFOHandler extends AbstractHandler {

    @Override
    public void handle(BigDecimal money) {
        if (money.compareTo(BigDecimal.valueOf(50000)) < 0) {
            System.out.println("CFO批准50000元以下的报销申请");
            return;
        }
        AbstractHandler nextHandler = getNextHandler();
        if (null == nextHandler) {
            System.out.println("您的报销金额已超额，直接找董事长吧");
            return;
        }
        nextHandler.handle(money);
    }
}
